<template>
  <div>
    <!-- <van-calendar v-model="dateshow" @confirm="onConfirm" /> -->
    <van-calendar
      v-model="dateshow"
      @close="closeXX"
      :close-on-click-overlay="true"
      type="range"
      @confirm="onConfirm"
      color="#1989fa"
    />
    <!-- <u-calendar mode="range" :allowSameDay="true"  round="0" showLunar rowHeight="80" :show="dateshow" @confirm="confirm"></u-calendar> -->
  </div>
</template>
 <script>
import moment from "moment";
export default {
  props: {
    // 布尔类型
    dateshow: {
      type: Boolean,
    },
  },
  watch:{
dateshow(val){
console.log(val);
}
  },
  created() {},
  mounted() {},
  methods: {
    closeXX() {
      this.$emit("closeCalendar", false);
    },
    onConfirm(e) {
      let data =
        moment(e[0]).format("YYYY/MM/DD") +
        "-" +
        moment(e[1]).format("YYYY/MM/DD");
      this.$emit("calendar", data);
      // console.log(data);
      // this.$emit("calendar", e)
    },
  },
};
</script>
